<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/pages/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
    <title><spring:message code="title.dictionary"/></title>
    <script type="text/javascript">
        var message =parent.message;
        function save_(){
            var isV =$("#tableForm").form("validate");
            if(!isV) return;
            imonJYRH.showZone();
            $.ajax({
                url : '${path}/basedata/dictionary/ajaxAdd.do',
                data : $("#tableForm *").serialize(),
                success : function(reMsg) {
                    if(reMsg.success){
                        parent.returnResult();
                        message.show({ msg : reMsg.msg,title : '<spring:message code='msg.tip'/>',showType:'slide'});
                    }else{
                        if(!imonJYRH.isBlank(reMsg.obj)){
                            $.messager.alert('<spring:message code='msg.tip'/>',reMsg['obj']);
                        }else{
                            $.messager.alert('<spring:message code='msg.tip'/>',reMsg['msg']);
                        }
                    }
                    imonJYRH.hideZone();
                }
            });
        }
    </script>
</head>
<body>
<table class="tableForm" id="tableForm" width="100%">
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.dictionary.code'/>:</td>
        <td align="left">
            <input type="text" name="code" class="easyui-validatebox" data-options="required:true">
        </td>
    </tr>
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.dictionary.name'/>:</td>
        <td align="left">
            <input type="text" name="name" class="easyui-validatebox" data-options="required:true">
        </td>
    </tr>
    <tr>
        <td align="right"><spring:message code='label.dictionary.detail'/>:</td>
        <td align="left">
            <input type="text" name="detail"/>
        </td>
    </tr>
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.dictionary.type'/>:</td>
        <td align="left">
            <input type="text" name="type" class="easyui-validatebox" data-options="required:true">
        </td>
    </tr>
    <tr>
        <td align="right"><spring:message code='label.dictionary.comment'/>:</td>
        <td align="left">
            <input type="text" style="width: 250px;" name="comment"/>
        </td>
    </tr>
</table>
<br/>
<div align="right">
    <a class="easyui-linkbutton" href="javascript:void(0);" iconCls="icon-save" onclick="save_();"><spring:message code='button.save'/></a>
    <a class="easyui-linkbutton" href="javascript:void(0);" iconCls="icon-no" onclick="parent.operateDialog.dialog('close');"><spring:message code='button.close'/></a>
</div>
</body>
</html>